<template>
  <div class="room-info">
    <div class="title-box" v-if="!only">
      <div class="title">
        {{ title }}
      </div>
      <div             v-if="status !== -1" class="circleBox">
        <div class="text">
          {{['','全部已归','全部未归','空闲','部分已归'][status]}}
        </div>
        <div
            :error="status === 2"
            :normal="status === 1"
            :warn="status === 4"
            class="circle"
        />
      </div>
    </div>
    <div class="room-info-wrap">
      <div v-for="(item, index) in datas" :key="index" class="wrap">
        <div class="title">
          {{ item.title }}
        </div>
        <div v-if="item.value" class="value">
          <div class="main">
            {{ item.value.main }}
          </div>
          <div v-if="item.value.sub" class="sub">
            {{ item.value.sub }}
          </div>
        </div>
        <div v-else class="value">
          --
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
// eslint-disable-next-line no-undef
defineProps({
  title: {
    type: String,
    default: "",
  },
  datas: {
    type: Array,
    default: () => [],
  },
  status: {
    type: Number,
    default: -1,
  },
  only: {
    type: Boolean,
    default: false,
  },
});
</script>

<style lang="less" scoped>
@import "./index.less";
</style>
